var attack = argument0;
var attacked = argument1;
var attacker = attack.attacker; //assume attack.attacker is of type player
var attackBonus = attacker.attackBonus;
var damageDealt = attackBonus;

for ( var i = 0; i <= EQUIPMENT.HEAD; i++)
{
    damageDealt += attacker.inventory.equipment[i].statEffects[STAT_EFFECTS.PHYS_ATK];
}
                  
//Because the player won't attack themself the enemy will only have their
//PHYS_DEF stat which will be handled as the percent resist.
var appliedDamage = damageDealt * (1 - attacked.attackDefense);
attacked.HPCurrent = attacked.HPCurrent - appliedDamage;
show_debug_message(attacked.HPCurrent);
if (attacked.HPCurrent < 0)
{
    with( attacked )
    {
        instance_destroy();
    }
}


//apply damage to attacked
